﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QuanLyCuaHangBanMayTinh.He_Thong_Du_Lieu;

namespace QuanLyCuaHangBanMayTinh.He_Thong_Xu_Ly
{
    class BaoHanhBUS
    {
        public static bool ThemMatHang(BaoHanhDTO mh)
        {
            if (BaoHanhDAO.SelectmhByName(mh.TenMatHang) == null)
            {
                BaoHanhDAO.Insert(mh);
                return true;
            }
            else
            {
                return false;
            }
        }

        public static bool XoaMATHANG(BaoHanhDTO mh)
        {
            if (BaoHanhDAO.SelectmhByName(mh.TenMatHang) == null)
            {
                BaoHanhDAO.Delete(mh);
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
